home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / amipro3 / macros.cmz / CROSSREF.SMM < prev    next >
Encoding:
INI File  |  1992-11-18  |  6.5 KB  |  498 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     _macro.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     PostScript Printer
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Genera referencias cruzadas entre los archivos de un documento maestro formado por menos de ocho archivos.
  19.     Lotus Word Processing Division
  20.     Advanced
  21.     FileOpen, MasterDocument
  22.     noautorun
  23.     714788048
  24.     38
  25.     672617318
  26.     409
  27.     2
  28.     325
  29.     2164
  30.     5
  31.     7
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     0
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [ParaNum]
  54.     1
  55. [tag]
  56.     Est<\a>ndar
  57.     5
  58.     [fnt]
  59.         Tms Rmn
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         17
  71.         0
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         0
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         24
  103.         1
  104.         2
  105.         ,
  106.         .
  107.         Pts
  108.     Est<\a>ndar
  109.     0
  110.     0
  111. [l1]
  112.     0
  113. [pg]
  114.     2
  115.     49 0 19 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  116.     91 0 12 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  117. [edoc]
  118. <+@><:#279,9025>' Xref - cross reference between files in a master document. Because the field
  119.  
  120. <+@><:#279,9025>'"Pageref" can only work with bookmarks in  the current file, when you need the page
  121.  
  122. <+@><:#279,9025>'number of  a bookmark in another file, you can insert  the powerfield    
  123.  
  124. <+@><:#279,9025>'getglobalvar$("BookmarkName")  after running this macro.  (Insert the name of  your
  125.  
  126. <+@><:#279,9025> 'bookmark in place of BookmarkName.) 
  127.  
  128. <+@><:#279,9025>'
  129.  
  130. <+@><:#279,9025>'This macro will run through all files in the master, and for each bookmark it will
  131.  
  132. <+@><:#279,9025> 'determine the actual page number, then create a global variable by that same name,
  133.  
  134. <+@><:#279,9025> 'and assign the  page number to it. Also the macro updates powerfields previously
  135.  
  136. <+@><:#279,9025> 'inserted 
  137.  
  138. <:#279,9025>
  139.  
  140. <:#279,9025>'This version is limited to 9 files
  141.  
  142. <:#279,9025>
  143.  
  144. <:#279,9025>Declare DebugArray(Array)
  145.  
  146. <:#279,9025>define IsOKToRun(menuname)    GetInfo(217, 24, %1);
  147.  
  148. <:#279,9025>
  149.  
  150. @Function@<:#293,9025>FUNCTION Xref()
  151.  
  152. <:#279,9025>IF IsNewWave()
  153.  
  154. <:#279,9025>    Message("Macro no disponible si se ejecuta en HP NewWave.")
  155.  
  156. <:#279,9025>    Exit Function
  157.  
  158. <:#279,9025>ENDIF
  159.  
  160. @Subhead@<:#279,9025>result=IsOKToRun(SaveAs)
  161.  
  162. @Subhead@<:#279,9025>if result !=1 exit function
  163.  
  164. @Subhead@<:#279,9025>endif
  165.  
  166. <:#279,9025>defstr mascount;
  167.  
  168. <:#279,9025>totpages = 0
  169.  
  170. <:#279,9025>
  171.  
  172. <:#279,9025>if (0 = Assign(&mascount, GetMasterFilesCount()))
  173.  
  174. <:#279,9025>    message("No es un documento maestro")
  175.  
  176. <:#279,9025>    return -1;
  177.  
  178. <:#279,9025>else
  179.  
  180. <:#279,9025>dim    masfiles(mascount)
  181.  
  182. <:#279,9025>GetMasterFiles(&masfiles)
  183.  
  184. <:#279,9025>DebugArray(&MasFiles)
  185.  
  186. <:#279,9025>mascount = arraysize(&masfiles)
  187.  
  188. <:#279,9025>for i = 1 to mascount    ' Generate left the last one up
  189.  
  190. <:#279,9025>ifopen = 0
  191.  
  192. <:#279,9025>    Count = GetOpenFileCount()
  193.  
  194. <:#279,9025>    IF Count <;> 0
  195.  
  196. <:#279,9025>    DIM Filess(Count)
  197.  
  198. <:#279,9025>    GetOpenFileNames(&Filess)
  199.  
  200. <:#279,9025>    FOR II = 1 to Count
  201.  
  202. <:#279,9025>    f = filess(II)
  203.  
  204. <:#279,9025>    if  f =  ucase$(masfiles(i)) and ifopen = 0 then
  205.  
  206. <:#279,9025>        ifopen = 1
  207.  
  208. <:#279,9025>    endif
  209.  
  210. <:#279,9025>    NEXT    
  211.  
  212. <:#279,9025>    endif
  213.  
  214. <:#279,9025>    if ifopen = 0 then
  215.  
  216. <:#279,9025>        FileOpen(masfiles(i), 1, "")
  217.  
  218. <:#279,9025>    else
  219.  
  220. <:#279,9025>    file = masfiles(i)
  221.  
  222. <:#279,9025>    selectwindow(file)
  223.  
  224. <:#279,9025>    endif
  225.  
  226. <:#279,9025>    DarkMode(1)
  227.  
  228. <:#279,9025>    type("<[>ctrlend]")    ' Force load to finish
  229.  
  230. <:#279,9025>    type("<[>ctrlhome]")    ' Back to the top for looks
  231.  
  232. <:#279,9025>    DarkMode(0)
  233.  
  234. <:#279,9025>    call CreateGlobals(totpages)
  235.  
  236. <:#279,9025>    totpages = totpages + evalfield("numpages")
  237.  
  238. <:#279,9025>    FieldUpdateAll()
  239.  
  240. <:#279,9025>next
  241.  
  242. <:#279,9025>endif
  243.  
  244. <:#279,9025>END FUNCTION
  245.  
  246. @Function@<:#293,9025>FUNCTION CreateGlobals(totpages)
  247.  
  248. <:#279,9025>defstr bookcnt
  249.  
  250. <:#279,9025>bookcnt = getbookmarkcount()
  251.  
  252. <:#279,9025>if  bookcnt = 0 
  253.  
  254. <:#279,9025>    return 0;    ' No bookmarks, fast exit here
  255.  
  256. <:#279,9025>else
  257.  
  258. <:#279,9025>dim booknames(bookcnt)
  259.  
  260. <:#279,9025>GetBookMarkNames(&booknames)
  261.  
  262. <:#279,9025>for i = 1 to bookcnt
  263.  
  264. <:#279,9025>    ' get the GetBookMarkPage returns the page number of the
  265.  
  266. <:#279,9025>    ' bookmark relative to this file, use PhysicalToLogical
  267.  
  268. <:#279,9025>    ' to the the logical page.  Then create a global var
  269.  
  270. <:#279,9025>    ' using the bookmark name, then assign that page number.
  271.  
  272. <:#279,9025>    page = totpages + getbookmarkpage(booknames(i))
  273.  
  274. <:#279,9025>    AllocGlobalVar(booknames(i), 1)    
  275.  
  276. <:#279,9025>    SetGlobalVar(booknames(i), page)
  277.  
  278. <:#279,9025>next
  279.  
  280. <:#279,9025>endif
  281.  
  282. <:#279,9025>END FUNCTION
  283.  
  284. <:#279,9025>
  285.  
  286. @Function@<:#293,9025>Function DebugArray(MasFiles)
  287.  
  288. <:#279,9025>Count = ArraySize(&MasFiles)
  289.  
  290. <:#279,9025>For t = 1 to count
  291.  
  292. <:#279,9025>    Info = *MasFiles(T)
  293.  
  294. <:#279,9025>    Message("{T} = {Info}")
  295.  
  296. <:#279,9025>Next
  297.  
  298. <:#279,9025>End Function
  299.  
  300. >
  301.  
  302. [Embedded]
  303. 00005060
  304. >
  305. [macsum] 3
  306. Xref 0 0 12 16
  307. CreateGlobals 968 1 5 64
  308. DebugArray 1287 1 4 84
  309. [macse]
  310. 14 Xref
  311. 0 1317
  312. 13
  313. 11 00000102
  314. 0 3 "Macro no disponible si se ejecuta en HP NewWave."
  315. 6 0
  316. 15
  317. 9
  318. 0 1313 217 24 104
  319. 13
  320. 8 1
  321. 6 1
  322. 5 1
  323. 18 1
  324. 11 00000171
  325. 6 0
  326. 15
  327. 9
  328. 5 0
  329. 8 3
  330. 5 0
  331. 0 1047
  332. 13
  333. 0 805 &2 [X]
  334. 13
  335. 18 0
  336. 11 00000295
  337. 0 3 "No es un documento maestro"
  338. 5 -1
  339. 15
  340. 9
  341. 10 00000956
  342. 6 2
  343. 21 4 [X]
  344. 0 1048 &4
  345. 16 DebugArray &4
  346. 0 1046 &4
  347. 13
  348. 8 2
  349. 5 1
  350. 8 5
  351. 6 2
  352. 6 5
  353. 18 2
  354. 12 00000444
  355. 10 00000956
  356. 5 1
  357. 6 5
  358. 3 0
  359. 8 5
  360. 10 00000369
  361. 5 0
  362. 8 6
  363. 0 1050
  364. 13
  365. 8 7
  366. 6 7
  367. 5 0
  368. 18 3
  369. 11 00000722
  370. 6 7
  371. 21 8 [X]
  372. 0 1051 &8
  373. 5 1
  374. 8 9
  375. 6 7
  376. 6 9
  377. 18 2
  378. 12 00000611
  379. 10 00000722
  380. 5 1
  381. 6 9
  382. 3 0
  383. 8 9
  384. 10 00000536
  385. 6 9
  386. 22 8
  387. 8 10
  388. 6 10
  389. 6 5
  390. 22 4
  391. 0 18 [X]
  392. 13
  393. 18 0
  394. 6 6
  395. 5 0
  396. 18 0
  397. 1 1
  398. 11 00000709
  399. 5 1
  400. 8 6
  401. 10 00000578
  402. 6 6
  403. 5 0
  404. 18 0
  405. 11 00000793
  406. 6 5
  407. 22 4
  408. 2 102 1 [X] 1 ""
  409. 10 00000824
  410. 6 5
  411. 22 4
  412. 8 11
  413. 0 796 "{11}"
  414. 0 292 1
  415. 0 6 "[16419]"
  416. 0 6 "[16420]"
  417. 0 292 0
  418. 16 CreateGlobals "{3}"
  419. 6 3
  420. 0 1289 "numpages"
  421. 13
  422. 3 0
  423. 8 3
  424. 2 267 1
  425. 10 00000411
  426. 6 0
  427. 15
  428. 9
  429. 14 CreateGlobals
  430. 0 1039
  431. 13
  432. 8 2
  433. 6 2
  434. 5 0
  435. 18 0
  436. 11 00000089
  437. 5 0
  438. 15
  439. 9
  440. 10 00000307
  441. 6 2
  442. 21 3 [X]
  443. 0 1040 &3
  444. 5 1
  445. 8 4
  446. 6 2
  447. 6 4
  448. 18 2
  449. 12 00000200
  450. 10 00000307
  451. 5 1
  452. 6 4
  453. 3 0
  454. 8 4
  455. 10 00000125
  456. 6 0
  457. 6 4
  458. 22 3
  459. 0 1049 [X]
  460. 13
  461. 3 0
  462. 8 5
  463. 6 4
  464. 22 3
  465. 0 271 [X] 1
  466. 6 4
  467. 22 3
  468. 0 264 [X] "{5}"
  469. 10 00000167
  470. 6 1
  471. 15
  472. 9
  473. 14 DebugArray
  474. 0 1046 &0
  475. 13
  476. 8 2
  477. 5 1
  478. 8 3
  479. 6 2
  480. 6 3
  481. 18 2
  482. 12 00000120
  483. 10 00000166
  484. 5 1
  485. 6 3
  486. 3 0
  487. 8 3
  488. 10 00000045
  489. 6 3
  490. 22 0
  491. 8 4
  492. 0 3 "{3} = {4}"
  493. 10 00000087
  494. 6 1
  495. 15
  496. 9
  497. 00005085
  498.